package com.leonzhangxf.spel.beandefinition.annotation;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * A demo use for annotation expression analysis in configure autowired injection.
 *
 * @author leonzhangxf
 * @date 20190427
 */
@Component
@Data
public class SimpleMovieLister {

    private MovieFinder movieFinder;

    private String defaultLocale;

    @Autowired
    public void configure(MovieFinder movieFinder,
                          @Value("#{ systemProperties['user.region'] }") String defaultLocale) {
        this.movieFinder = movieFinder;
        this.defaultLocale = defaultLocale;
    }

    @Component
    @Data
    public static class MovieFinder {
        private String finder;
    }
}
